export default function (data, indexs) {
    let tabList = data;
    let lineListStr = ``;
    let style = `
                <style>
                    .commonTabline{
                        width: 100%;
                        height: 1.067rem;
                        padding: 0 0.267rem;
                        box-sizing: border-box;
                        display: flex;
                        justify-content: space-between;
                        background: white;
                        border-bottom: 0.013rem solid #e5e5e5;
                        float: left;
                    }
                    .commonTablineItem{
                        font-size: 0.35rem;
                        float: left;
                        color: #999;
                        width: ${94 / tabList.length}%;
                        text-align: center;
                        line-height: 1.067rem;
                        position: relative;
                    }
                    .borderBottom{
                        position: absolute;
                        height: 0.067rem;
                        width: 1.067rem;
                        bottom: 0;
                        left: 50%;
                        margin-left: -0.533rem;
                        background: #008be6;
                    }
                </style>
                `;
    console.log(data.currentTabIndex)
    tabList.forEach((item, index) => {
        console.log(indexs, index)
        lineListStr += `<div class="commonTablineItem" style="color: ${indexs === index ? 'black' : '#999'}">${item.test}<span class="borderBottom" style="display: ${indexs === index ? 'block' : 'none'}"></span></div>`
    });
    let html = `
               <div class="commonTabline">
                    ${lineListStr}
               </div> 
               `;
    window.nbasics.differAction(() => {
        let commonTablineItem = document.querySelectorAll('.commonTablineItem');
        tabList.forEach((item, index) => {
            commonTablineItem[index].onclick = function () {
                console.log(item.path)
                window.nbasics.touchBack({"path": item.path, data: JSON.stringify({})})
            }
        });
    });
    return (`<div style="overflow: hidden">${style}${html}</div>`);
}